package com.hyz.login.mapper;

import com.hyz.login.model.Register;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyz.login.model.Registeredtype;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zwq
 * @since 2022-11-28
 */
public interface RegisterMapper extends BaseMapper<Register> {

    //查询入院人员
    List<Register> findAll(@Param("userName") String userName,
                                 @Param("page") Integer page,
                                 @Param("limit") Integer limit);

    Integer modifyByRegId(@Param("registerid") Integer registerid,
                          @Param("departmentId") Integer departmentId,
                          @Param("doctorId") Integer doctorId,
                          @Param("bedId") Integer bedId);

    Register findById(@Param("registerid") Integer registerid);

    @Update("update register set money = money+#{moneys} where registerid = #{registerid}")
    Integer modifyMoney(@Param("registerid") Integer registerid,
                        @Param("moneys") Integer moneys);
}
